import requests
from common.token_login import login_token

result = login_token()
token = login_token().json()["data"]
print(token)

class IhrmAddEmp:
    def add_emp(self, req_data):
        resp = requests.post(url="http://ihrm2-test.itheima.net/api/sys/user",
                             headers={"Content-Type": "application/json",
                                      "Authorization": token},
                             json=req_data)
        return resp

if __name__ == '__main__':
    add = IhrmAddEmp()
    req_data = {
        "username": "哼哈二将0000794568",
        "mobile": "05505566508",
        "workNumber": "123"
    }
    resp = add.add_emp(req_data)
    print(resp.json())
